//
//  PKTextField.swift
//  Panku
//
//  Created by mac on 2017/2/10.
//  Copyright © 2017年 Monster. All rights reserved.
//

import UIKit

class PKTextField: UITextField {
    
    //MARK: - properties
    lazy var seperationView = UIView()

    //MARK: - init
    init() {
        super.init(frame: CGRect.zero)
        setupTextField()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    //MARK: - setup
    private func setupTextField() -> Void{
        self.addSubview(seperationView)
        
        seperationView.backgroundColor = UIColor.white
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        let height:CGFloat = 1.0
        
        let x:CGFloat = 0.0
        let y:CGFloat = self.height - height
        let width = self.width
        
        seperationView.frame = CGRect(x: x, y: y, width: width, height: height)
    }

}
